EMT Practice Test

1. Question Content...


Question List

Question1: A topic receives all the orders for the products that are available on a commerce site. Two applications want to process all the messages independently - order fulfilment and monitoring. The topic has 4 partitions, how would you organise the consumers for optimal performance and resource usage?

Question2: If I want to have an extremely high confidence that leaders and replicas have my data, I should use

Question3: What's is true about Kafka brokers and clients from version 0.10.2 onwards?

Question4: A Zookeeper configuration has tickTime of 2000, initLimit of 20 and syncLimit of 5. What's the timeout value for followers to connect to Zookeeper?

Question5: Producing with a key allows to...

Question6: How will you find out all the partitions without a leader?

Question7: Where are the ACLs stored in a Kafka cluster by default?

Question8: There are 3 producers writing to a topic with 5 partitions. There are 10 consumers consuming from the topic as part of the same group. How many consumers will remain idle?

Question9: Which KSQL queries write to Kafka?

Question10: The rule "same key goes to the same partition" is true unless...

Question11: Which of the following is not an Avro primitive type?

Question12: You are building a consumer application that processes events from a Kafka topic. What is the most important metric to monitor to ensure real-time processing?

Question13: There are 3 brokers in the cluster. You want to create a topic with a single partition that is resilient to one broker failure and one broker maintenance. What is the replication factor will you specify while creating the topic?

Question14: A bank uses a Kafka cluster for credit card payments. What should be the value of the property unclean.leader.election.enable?

Question15: Select the Kafka Streams joins that are always windowed joins.

Question16: How does a consumer commit offsets in Kafka?

Question17: A consumer wants to read messages from partitions 0 and 1 of a topic topic1. Code snippet is shown below.
consumer.subscribe(Arrays.asList("topic1"));
List<TopicPartition> pc = new ArrayList<>();
pc.add(new PartitionTopic("topic1", 0));
pc.add(new PartitionTopic("topic1", 1));
consumer.assign(pc);

Question18: How do Kafka brokers ensure great performance between the producers and consumers? (select two)

Question19: When is the onCompletion() method called?
private class ProducerCallback implements Callback {
@Override
public void onCompletion(RecordMetadata recordMetadata, Exception e) {
if (e != null) {
e.printStackTrace();
}
}
}
ProducerRecord<String, String> record =
new ProducerRecord<>("topic1", "key1", "value1");
producer.send(record, new ProducerCallback());

Question20: A consumer wants to read messages from a specific partition of a topic. How can this be achieved?

Question21: A Zookeeper ensemble contains 5 servers. What is the maximum number of servers that can go missing and the ensemble still run?

Question22: Which of the following is true regarding thread safety in the Java Kafka Clients?

Question23: How often is log compaction evaluated?

Question24: What is the disadvantage of request/response communication?

Question25: Which actions will trigger partition rebalance for a consumer group? (select three)

Question26: What's a Kafka partition made of?

Question27: To read data from a topic, the following configuration is needed for the consumers

Question28: What is the risk of increasing max.in.flight.requests.per.connection while also enabling retries in a producer?

Question29: To continuously export data from Kafka into a target database, I should use

Question30: You want to send a message of size 3 MB to a topic with default message size configuration. How does KafkaProducer handle large messages?

Question31: What exceptions may be caught by the following producer? (select two)
ProducerRecord<String, String> record =
new ProducerRecord<>("topic1", "key1", "value1");
try {
producer.send(record);
} catch (Exception e) {
e.printStackTrace();
}

Question32: By default, which replica will be elected as a partition leader? (select two)

Question33: What are the requirements for a Kafka broker to connect to a Zookeeper ensemble? (select two)

Question34: Where are KSQL-related data and metadata stored?

Question35: What happens if you write the following code in your producer? producer.send(producerRecord).get()

Question36: If I supply the setting compression.type=snappy to my producer, what will happen? (select two)

Question37: In the Kafka consumer metrics it is observed that fetch-rate is very high and each fetch is small. What steps will you take to increase throughput?

Question38: A topic has three replicas and you set min.insync.replicas to 2. If two out of three replicas are not available, what happens when a produce request with acks=all is sent to broker?

Question39: I am producing Avro data on my Kafka cluster that is integrated with the Confluent Schema Registry. After a schema change that is incompatible, I know my data will be rejected. Which component will reject the data?

Question40: How will you find out all the partitions where one or more of the replicas for the partition are not in-sync with the leader?

Question41: Your topic is log compacted and you are sending a message with the key K and value null. What will happen?

Question42: You are running a Kafka Streams application in a Docker container managed by Kubernetes, and upon application restart, it takes a long time for the docker container to replicate the state and get back to processing the dat a. How can you improve dramatically the application restart?

Question43: If I want to send binary data through the REST proxy, it needs to be base64 encoded. Which component needs to encode the binary data into base 64?

Question44: How can you gracefully make a Kafka consumer to stop immediately polling data from Kafka and gracefully shut down a consumer application?

Question45: How will you read all the messages from a topic in your KSQL query?

Question46: How will you set the retention for the topic named my-topic to 1 hour?

Question47: When auto.create.topics.enable is set to true in Kafka configuration, what are the circumstances under which a Kafka broker automatically creates a topic? (select three)

Question48: You are using JDBC source connector to copy data from 2 tables to two Kafka topics. There is one connector created with max.tasks equal to 2 deployed on a cluster of 3 workers. How many tasks are launched?

Question49: What is a generic unique id that I can use for messages I receive from a consumer?

Question50: A consumer is configured with enable.auto.commit=false. What happens when close() is called on the consumer object?